Telegram Group & Telegram Channel
🐍 Задача про умножение матриц

Условие: Вам даны две матрицы, нужно написать функцию для их умножения. Матрицы могут быть квадратными или прямоугольными.

Решение: Напишем решение на чистом Python
def matrix_multiply(A, B):
# Сначала проверим, можем ли мы вообще перемножить эти матрицы
if len(A[0]) != len(B):
raise ValueError("Number of A columns must equal number of B rows.")

# Инициализируем результирующую матрицу, заполненную нулями
result = [[0 for _ in range(len(B[0]))] for _ in range(len(A))]

# Перемножим матрицы
for i in range(len(A)):
for j in range(len(B[0])):
for k in range(len(B)):
result[i][j] += A[i][k] * B[k][j]

return result

# Проверим функцию на примере
A = [[1, 2, 3],
[4, 5, 6]]

B = [[7, 8],
[9, 10],
[11, 12]]

result = matrix_multiply(A, B)
for row in result:
print(row)


#программирование
#линейная_алгебра



tg-me.com/ds_interview_lib/268
Create:
Last Update:

🐍 Задача про умножение матриц

Условие: Вам даны две матрицы, нужно написать функцию для их умножения. Матрицы могут быть квадратными или прямоугольными.

Решение: Напишем решение на чистом Python

def matrix_multiply(A, B):
# Сначала проверим, можем ли мы вообще перемножить эти матрицы
if len(A[0]) != len(B):
raise ValueError("Number of A columns must equal number of B rows.")

# Инициализируем результирующую матрицу, заполненную нулями
result = [[0 for _ in range(len(B[0]))] for _ in range(len(A))]

# Перемножим матрицы
for i in range(len(A)):
for j in range(len(B[0])):
for k in range(len(B)):
result[i][j] += A[i][k] * B[k][j]

return result

# Проверим функцию на примере
A = [[1, 2, 3],
[4, 5, 6]]

B = [[7, 8],
[9, 10],
[11, 12]]

result = matrix_multiply(A, B)
for row in result:
print(row)


#программирование
#линейная_алгебра

BY Библиотека собеса по Data Science | вопросы с собеседований


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/ds_interview_lib/268

View MORE
Open in Telegram


Библиотека собеса по Data Science | вопросы с собеседований Telegram | DID YOU KNOW?

Date: |

Look for Channels Online

You guessed it – the internet is your friend. A good place to start looking for Telegram channels is Reddit. This is one of the biggest sites on the internet, with millions of communities, including those from Telegram.Then, you can search one of the many dedicated websites for Telegram channel searching. One of them is telegram-group.com. This website has many categories and a really simple user interface. Another great site is telegram channels.me. It has even more channels than the previous one, and an even better user experience.These are just some of the many available websites. You can look them up online if you’re not satisfied with these two. All of these sites list only public channels. If you want to join a private channel, you’ll have to ask one of its members to invite you.

Importantly, that investor viewpoint is not new. It cycles in when conditions are right (and vice versa). It also brings the ineffective warnings of an overpriced market with it.Looking toward a good 2022 stock market, there is no apparent reason to expect these issues to change.

Библиотека собеса по Data Science | вопросы с собеседований from sa


Telegram Библиотека собеса по Data Science | вопросы с собеседований
FROM USA